package com.lagou.feign;

import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;


@Slf4j
@Component
public class CodeServiceFeignFallBack implements FallbackFactory<CodeServiceFeignClient> {
    @Override
    public CodeServiceFeignClient create(Throwable throwable) {
        return (email, code) -> {
            log.error("校验验证码调用失败, {}", throwable.getMessage());
            return null;
        };
    }
}
